using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace RapidHDL
{
    public partial class FSelectHardware : Form
    {
        string sSelected;

        public string SelectedHardware
        {
            get { return sSelected; }
        }

        public FSelectHardware()
        {
            InitializeComponent();
        }

        public void Initialize(MasterWorkbench poWorkbench)
        {
            foreach (string sHardware in poWorkbench.RapidHardwares.Keys)
            {
                lstHardware.Items.Add(sHardware);
            }
        }

        private void FSelectHardware_Load(object sender, EventArgs e)
        {

        }

        private void cmdCancel_Click(object sender, EventArgs e)
        {
            sSelected = "";
            this.Close();
        }

        private void cmdOK_Click(object sender, EventArgs e)
        {
            sSelected = (string)lstHardware.Items[lstHardware.SelectedIndex];
            this.Close();
        }
    }
}